package main

import (
	_ "go.uber.org/automaxprocs"
	"go.uber.org/zap"

	"zjhk/core"
	"zjhk/global"
	"zjhk/initialize"
)

//go:generate go env -w GO111MODULE=on
//go:generate go env -w GOPROXY=https://goproxy.cn,direct
//go:generate go mod tidy
//go:generate go mod download

func main() {
	global.GVA_VP = core.Viper() // 初始化Viper
	global.GVA_LOG = core.Zap()  // 初始化zap日志库
	zap.ReplaceGlobals(global.GVA_LOG)
	global.GVA_DB = initialize.Gorm() // gorm连接数据库
	initialize.Timer()
	initialize.DBList()
	wsServer := global.NewServer()
	global.KPR_WS = wsServer
	go wsServer.Run()
	core.RunWindowsServer()
}
